<template>
  <div id="app">
    <chamoip type="icon-jiangpaijinpai01"/>
    <a-table :columns="columns" bordered :data-source="data" :pagination="false"/>
  </div>
</template>

<script>
import {user} from './api/user'
import {Icon} from "ant-design-vue";

const Chamoip = Icon.createFromIconfontCN({
  scriptUrl: '//at.alicdn.com/t/font_2815928_hse8l0iexan.js'
})

export default {
  name: 'App',
  components: {
    Chamoip
  },
  data() {
    return {
      user: {},
      data: [
        {
          nameFirst: "何禹",
          rateFirst: 10,
          nameSecond: "叶旭葳",
          rateSecond: 12,
          nameThird: "朱才华",
          rateThird: 14
        }
      ],
      columns: [
        {
          title: "CDE-GRP 代码打回季度报告",
          children: [
            {
              title: "2021-06",
              children: [
                {
                  title: "姓名",
                  dataIndex: "nameFirst",
                  key: "nameFirst",
                  width: 200
                },
                {
                  title: "打回率(%)",
                  dataIndex: "rateFirst",
                  key: "rateFirst",
                  width: 200
                }
              ]
            },
            {
              title: "2021-07",
              children: [
                {
                  title: "姓名",
                  dataIndex: "nameSecond",
                  key: "nameSecond",
                  width: 200
                },
                {
                  title: "打回率(%)",
                  dataIndex: "rateSecond",
                  key: "rateSecond",
                  width: 200
                }
              ]
            },
            {
              title: "2021-08",
              children: [
                {
                  title: "姓名",
                  dataIndex: "nameThird",
                  key: "nameThird",
                  width: 200
                },
                {
                  title: "打回率(%)",
                  dataIndex: "rateThird",
                  key: "rateThird",
                  width: 200
                }
              ]
            }
          ]
        }
      ]
    }
  },
  mounted() {
    user("1").then(res => {
      console.log(res.data)
      this.user = res.data
    })
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
